#include <iostream>
#include <fstream>
#include <cmath>
#include <vector>
#include <map>
#include <string>
#include <string.h>
using namespace std;

const int MAX_SIZE = 310;
char a[MAX_SIZE][MAX_SIZE];
char tpl[MAX_SIZE];

static bool CheckH(int si, int sj, int p) {
    //cout << "CHECK H: " << si << "\t" << sj << endl;
    for (int k = 0; k < p; ++k) {
        if (tpl[k] == '?')
            continue;
        if (a[si][sj+k] != tpl[k])
            return false;
    }
    return true;
}

static bool CheckV(int si, int sj, int p) {
    //cout << "CHECK V: " << si << "\t" << sj << endl;
    for (int k = 0; k < p; ++k) {
        if (tpl[k] == '?')
            continue;
        if (a[si+k][sj] != tpl[k])
            return false;
    }
    return true;
}

int main() {
    //
    ifstream ifile("input.txt");
    int n, m;
    ifile >> n >> m;
    string line;
    for (int i = 0; i < n; ++i) {
        ifile >> line;
        strcpy(a[i], line.c_str());
    }

    int p;
    ifile >> p;
    ifile >> tpl;
    ifile.close();

    //
    int res = 0;

    for (int i = 0; i <= (n-p); ++i) {
        for (int j = 0; j < m; ++j) {
            if (CheckV(i, j, p)) {
                //cout << "v:" << i << "\t" << j << endl;
                ++res;
            }
        }
    }

    for (int i = 0; i < n; ++i) {
        for (int j = 0; j <= (m-p); ++j) {
            if (CheckH(i, j, p)) {
                //cout << "h:" << i << "\t" << j << endl;
                ++res;
            }
        }
    }

    ofstream ofile("output.txt");
    ofile << res;
    ofile.close();
    return 0;
}
